# 该文件存在变量,方便全局调用.

class MyValue:
    _instance = None

    def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = super().__new__(cls)
        return cls._instance

    def __init__(self):
        if not hasattr(self, '已初始化'):
            self.整数值 = 88
            self.已初始化 = True  # 标记已初始化，防止重复初始化,该属性不能删除


# 全局实例
mo = MyValue()

# 验证单例模式
if __name__ == "__main__":
    a = MyValue()
    b = MyValue
